class B_TREE_DBG{KEY<$IS_LT{KEY},ELT}<$MAP{KEY,ELT}


Ancestors
$MAP{_,_} $RO_MAP{_,_} $STR $CONTAINER{_}
$ELT{_} $ELT



Public


Readable Attributes
attr size: INT; .. Included as size

Features
aget( k: KEY ): ELT .. Included as aget
aset( k: KEY, d: ELT ) .. Included as aset
**** Associate d with k and store it in the btree. If this key already exists in the btree the data will be overwritten. Association void to the key is equivalent to delete the key with its data.
copy: SAME .. Included as copy
create: SAME .. Included as create
debug: STR
****
--------------------------------------------------------------------
delete( k: KEY ) .. Included as delete
**** Remove the key and its associated elt from the btree.
delete( k: KEY ): ELT .. Included as delete
**** Removes the key and its associated elt from the btree. Returns the element being deleted or void if none found.
has( e: ELT ): BOOL .. Included as has
has_elt( e: ELT ): BOOL .. Included as has_elt
has_ind( k: KEY ): BOOL .. Included as has_ind
**** Answer 'true' if such a key exists within the btree.
str: STR .. Included as str

Iters
elt!: ELT .. Included as elt!
**** Yield all elt in order of the keys.
ind!: KEY .. Included as ind!
**** Yield all keys in-order.
pair!: TUP{KEY,ELT} .. Included as pair!
**** Yield all pairs of key and elt in the order of the keys.


Private

elt_eq(e1,e2:ETP):BOOL .. Included as elt_eq
**** The "less than" relation used in the sorting routines. Compares the object "id" by default. May be redefined in descendants.
elt_hash(e:ETP):INT .. Included as elt_hash
**** A hash value associated with an element. Must have the property that if "elt_eq(e1,e2)" then "elt_hash(e1)=elt_hash(e2)". Can be defined to always return 0, but many routines will then become quadratic. Uses object "id" by default. May be redefined in descendants.
elt_lt(e1,e2:ETP):BOOL .. Included as elt_lt
**** The "less than" relation used in the sorting routines. Compares the object "id" by default. May be redefined in descendants.
elt_nil: ETP .. Included as elt_nil
**** Return the nil value. If the element is under $NIL then return e.nil. Otherwise, return void
_
is_elt_nil(e:ETP):BOOL .. Included as is_elt_nil
attr root: NODE; .. Included as root
attr root: NODE; .. Included as root
attr size: INT; .. Included as size

The Sather Home Page